// 提供商品相关的API函数
import request from '@/utils/request'
// 获取商品详情数据
export const findGoodsDetail = (id) => {
  return request('/goods', 'get', { id })
}
// 获取商品同类推荐-未传入id时为猜你喜欢 id-商品ID，limit-获取条数
export const findRelGoods = (id, limit = 16) => {
  return request('/goods/relevant', 'get', { id, limit })
}
// 获取热销榜商品-type-1代表24小时热销榜，2代表周热销榜，3代表总热销榜，limit代表获取个数
export const findHotGoods = (id, type, limit = 3) => {
  return request('/goods/hot', 'get', { id, type, limit })
}
// 获取商品评价统计信息
export const findCommentInfo = (id) => {
  return request(`https://mock.boxuegu.com/mock/1175/goods/${id}/evaluate`, 'get')
}
// 获取商品评价列表
export const findGoodsCommentList = (id, params) => {
  return request(`https://mock.boxuegu.com/mock/1175/goods/${id}/evaluate/page`, 'get', params)
}
// 搜索商品
export const findSearchGoods = (data) => {
  return request('/search/all', 'post', data)
}
// 搜索提示语
export const findTipsBysearch = (keyword) => {
  return request('/search/tips', 'get', { keyword })
}
